-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GradCAM integration - Make YOLOv5 Interpretable #10649
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Hi @pourmand1376, your efforts towards making yolov5 interpretable are appreciable!!
|
Hi @hlmhlr, Thank you for your efforts in implementing EigenCAM with YOLOv5. We appreciate your dedication to making YOLOv5 interpretable. The community is looking forward to seeing the code you used to implement EigenCAM and its perfect functioning. It would be great if you could share the code with us. Your contribution will add value to YOLOv5 and help users understand the reasoning behind model predictions on a per-image basis. The heatmap examples you shared look promising and will greatly enhance interpretability. We understand that you are still working on documenting the implementation. It would be helpful if you can complete the documentation to provide a better understanding of how EigenCAM works with YOLOv5. Thank you once again for your efforts, and we look forward to your code contribution. |
Hi @pourmand1376, You can use this link and simply change the GradCAM implementation to EigenCAM. This should allow you to use EigenCAM with YOLOv5 and achieve the desired results. Please let me know if you have any further questions or need any additional assistance. Best, |
Hi @glenn-jocher and @pourmand1376, I gone through the code to the link that you shared, its working fine. Many thanks for your input. Further, I have slightly modified the code of @pourmand1376
I am attaching the snapshots below:
I believe, the changes are significant and beneficial to the YOLOv5 project as a whole, they should be integrated along with the pull request of @pourmand1376. Further, @glenn-jocher and @pourmand1376, please suggest how to proceed? Many thanks and kind regards, |
Hi, The changes you made are interesting. It am flattered that someone continued what I've done. I think, maybe, it is better to sync these changes to YOLOv7 as YOLOv5 is not maintained anymore, I assume. |
Dear @pourmand1376, I have created the pull request here along with your contribution. You can check the details. Sure, we can do it for the YOLOv7, however, the maintenance of YOLOv5 and merging of the pull request in that may be confirmed by the @glenn-jocher. |
@pourmand1376
|
@nyj-ocean the error you encountered seems to be related to an unsupported operand type when using the To investigate further, could you please provide more details about the input data and the specific steps you took when running the code? This will help us identify the root cause of the issue and provide a suitable solution. In the meantime, please ensure that you have the necessary dependencies installed and that your input data is in the correct format for the Looking forward to your response so that we can assist you further. |
👋 Hello there! We wanted to let you know that we've decided to close this pull request due to inactivity. We appreciate the effort you put into contributing to our project, but unfortunately, not all contributions are suitable or aligned with our product roadmap. We hope you understand our decision, and please don't let it discourage you from contributing to open source projects in the future. We value all of our community members and their contributions, and we encourage you to keep exploring new projects and ways to get involved. For additional resources and information, please see the links below:
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
Why this PR?
This PR will adapt
GradCAM
library toYOLOv5
. This is required since black box models are not always acceptable. We need to know why a certain prediction was made. This is completely different fromfeature visualization
which is already implemented. This explains the model results on a per image basis. For example, we want to know why the model has detected this Person. What pixels are mostly responsible for this prediction? This will result in a heatmap like this.EigenCAM layer -2:
EigenCAM layer -3:
Current State
Currently, I've implemented EigenCAM and it works perfectly. Still, I have to write documentation to understand how it works.
Related Issues and Links
This is a long-requested feature.
YOLOv5 Related issues:
Related Issues in other repositories:
Useful Links:
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
WARNING⚠️ this PR is very large, summary may not cover all changes.
🌟 Summary
This PR introduces new Makefile options and Jupyter notebook improvements for interpretability demos.
📊 Key Changes
run_interpretability
andrun_interpretability_old
commands to Makefile for running interpretability scripts..pre-commit-config.yaml
to exclude the demo notebook from the codespell check.🎯 Purpose & Impact